import BaseMapper from "./BaseMapper";
import SystemMember from "../entity/SystemMember";
import SqlStatement from "../sql/SqlStatement";

export default class TestMapper implements BaseMapper<SystemMember> {
    deleteById(statement: SqlStatement) {
        statement.run().then(res => {
            console.log(res)
        }).catch(err => {
            console.log(err)
        });
    }

    insert(statement: SqlStatement) {
        statement.run().then(res => {
            console.log(res)
        }).catch(err => {
            console.log(err)
        });
    }

    updateById(statement: SqlStatement) {
        statement.run().then(res => {
            console.log(res)
        }).catch(err => {
            console.log(err)
        });
    }

    async page(statement: SqlStatement) {
        const rows = await statement.all();
        const count = await statement.count();
        console.log(rows, count)
    }

}
